local wuqian = fk.CreateSkill {
  name = "lvshi__wuqian",
  tags = { Skill.Compulsory },
}

Fk:loadTranslationTable{
  ["lvshi__wuqian"] = "无前",
  [":lvshi__wuqian"] = "锁定技，你使用【决斗】的目标上限数+2；你的回合内，若你未于此回合造成过伤害，则你的黑色锦囊牌视为【决斗】。",

  ["$lvshi__wuqian1"] = "且断轮回化魔躯，不擒汝首誓不还！",
  ["$lvshi__wuqian2"] = "神魔天征，挡我者死！",
}

wuqian:addEffect(fk.DamageFinished, {
  anim_type = "offensive",
  can_refresh = function(self, event, target, player, data)
    if player:hasSkill(wuqian.name) and data.from == player and player.room.current == player then
      return player:getMark("wuqian-turn") == 0
    end
  end,
  on_refresh = function(self, event, target, player, data)
    player.room:addPlayerMark(player, "wuqian-turn")
    player:filterHandcards()
  end,
})

wuqian:addEffect("filter", {
  anim_type = "offensive",
  card_filter = function(self, card, player)
    return player:hasSkill(wuqian.name) and card.type == Card.TypeTrick and card.color == Card.Black and
      (table.contains(player:getHandlyIds(), card.id)) and player == Fk:currentRoom().current and player:getMark("wuqian-turn") == 0
  end,
  view_as = function(self, player, card)
    return Fk:cloneCard("duel", card.suit, card.number)
  end,
})

wuqian:addEffect("targetmod", {
  extra_target_func = function(self, player, skill, card)
    if player:hasSkill(wuqian.name) and card.trueName == "duel" then
      return 2
    end
  end,
})

return wuqian